//
//  NSObject+AI.swift
//  ArtAIClassSwift
//
//  Created by mal on 2019/11/21.
//  Copyright © 2019 meishubao.com. All rights reserved.
//

import Foundation

public extension NSObject {
    /// 返回className
    var aiClassName: String {
        get{
            let name =  type(of: self).description()
            if (name.contains(".")) {
                let nameArray = name.components(separatedBy: ".")
                if nameArray.count > 1 {
                    return nameArray[1]
                }
            }
            return name
        }
    }
    
    /// 返回类名
    static var ml_className: String {
        return String(describing: self)
    }
}

